//
//  RobbCoreModule.swift
//  Pods
//
//  Created by eme on 2017/3/24.
//
//

import Foundation


/// 本模块的名称， 本模块的storyboard 名称必须 与模块名称相同 ,已经用于静态资源的加载回用到
let modularName = "RobbCore"

/// 登陆模块 基础配置文件
public  class RobbCore {
    
    public static var sharedInstance : RobbCore {
        struct Static {
            static let instance : RobbCore = RobbCore()
        }
        return Static.instance
    }
    /// 登陆模块的storyboard
    public static var storyboard:UIStoryboard{
        get{
            return UIStoryboard(name: modularName, bundle: RobbCore.bundle)
        }
    }
    /// 模块中的 首页
    public static var homePageVc:UIViewController{
        get{
            return RobbCore.storyboard.instantiateViewController(withIdentifier: "HomePage_Vc")
        }
    }
    
    ///供其他模块使用
    public static var bundle:Bundle?{
        get{
            guard let bundleURL = Bundle(for: HomePage_Vc.self).url(forResource: modularName, withExtension: "bundle") else {
                return nil
            }
            guard let bundle = Bundle(url: bundleURL) else {
                return nil
            }
            return bundle
        }
        
    }
    
    init() {
        //        guard let path = Bundle.main.path(forResource: "RobbCore", ofType: "plist") else {
        //            return
        //        }
        //        guard let dict = NSDictionary(contentsOfFile:path) else {
        //            return
        //        }
        //        
    }
}
